//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __CC_H_
#define __CC_H_
#include <string.h>
#include <eladef.h>

typedef unsigned char   u8_t;
typedef signed char            s8_t;
typedef unsigned short  u16_t;
typedef short           s16_t;
typedef unsigned long   u32_t;
typedef long            s32_t;
//typedef unsigned char* mem_ptr_t;
typedef u32_t           mem_ptr_t;

#define PACK_STRUCT_USE_INCLUDES

#if defined(_GNUC)
#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
#else
#define PACK_STRUCT_FIELD(x) x
#endif

#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END

#ifdef __cplusplus
extern "C" {
#endif

int    __cdecl kprintf (const char *, ...);
void __cdecl rtl8139_output(unsigned char *p, int len, void *pNetDriver);
size_t __cdecl _wcstostr(char *str, const wchar_t *wcs);
int __cdecl get_thread_exit_flag(void *pThreadExitArg);
void __cdecl set_thread_exit_flag(void *pThreadExitArg, int flag);  
void __cdecl net_thread_kill(void *pTArg);
void __cdecl LwipSleep(int ms);
void __cdecl free(void *pv);
void * __cdecl malloc(size_t size);
void* getthreadpointer();
void setgloblepoint(void * addr);
int getrandomvalue(int scope);
void* mt_malloc();
void mt_lock(void * mt);
void mt_unlock(void* mt);
void mt_free(void* mt);
void sem_addref(void * mt, void* sem);
void sem_release(void * mt, void* sem);
void sem_releaseAndFree(void * sem);
extern int SetNetAttribute(void *pnetif, u32_t ip, u32_t mask, u32_t gw, u32_t firstdns, u32_t seconddns);

#ifdef __cplusplus
}
#endif



#define LWIP_PLATFORM_ASSERT(x)    do{kprintf("panic:"x);DebugBreak();}while(0)
#define LWIP_PLATFORM_DIAG(x) do{kprintf x;}while(0)

#endif //__CC_H_

